import {computed, ref} from 'vue'
import {defineStore} from 'pinia'

export const usePcKeyStore = defineStore('pckey', () => {
    const pckey = ref({
        "control": {
            "key2op_lst": {
                "27": [0, 347, 596, 809, 7, 233, 197],
                "87": [151, 228, 485, 861, 1, 183, 306],
                "83": [152, 486, 2, 184],
                "65": [483, 517, 632, 812, 3, 54, 120, 156, 188, 252, 314, 654, 407],
                "68": [181, 484, 518, 633, 813, 4, 65, 121, 191, 253, 315, 655, 408],
                "32": [53, 312, 469, 474, 491, 511, 513, 514, 530, 554, 619, 631, 638, 811, 859, 883, 5, 55, 128, 446, 271, 311, 649, 480, 136, 389, 455],
                "192": [6],
                "67": [158, 319, 257, 8, 137, 595, 603],
                "97": [644, 9],
                "98": [645, 10],
                "99": [646, 11],
                "100": [647, 12],
                "101": [13],
                "102": [14],
                "90": [157, 856, 15],
                "88": [155, 16, 534, 607],
                "118": [329, 17],
                "119": [328, 18],
                "9": [414, 473, 700, 159, 19],
                "74": [567, 701, 273, 427, 20],
                "52": [163, 167, 231, 337, 470, 804, 147, 224, 263, 1502, 616, 109, 21],
                "53": [168, 287, 338, 805, 225, 264, 1503, 617, 22],
                "115": [346, 402, 413, 703, 23],
                "116": [348, 24],
                "103": [30],
                "104": [31],
                "86": [411, 866, 882, 886, 32, 110, 114, 255, 139, 192, 430, 131, 145, 169, 202, 250, 232, 251, 291, 308, 353, 397, 420, 421, 502, 520, 522, 584, 634, 652, 395, 453, 458, 610],
                "77": [636, 33, 580, 606],
                "71": [305, 416, 576, 577, 621, 190, 48, 123, 196, 203, 270, 276, 558, 585, 59, 450],
                "81": [153, 154, 278, 279, 299, 487, 510, 528, 550, 551, 553, 563, 624, 820, 850, 857, 860, 51, 67, 119, 185, 229, 300, 301, 345, 477, 194, 102, 124, 186, 512, 479, 280, 385, 578, 586, 597, 598, 873, 874, 875, 876, 591],
                "69": [150, 403, 488, 525, 564, 569, 611, 625, 819, 851, 858, 862, 478, 52, 103, 104, 302, 386, 608],
                "16": [343, 626, 56, 392],
                "17": [344, 623, 57, 393],
                "70": [490, 492, 568, 620, 810, 855, 884, "105_1", "105_5", "105_9", "105_11", "105_55", "105_27", "105_28", "105_29", "105_38", "105_39", "105_56", "105_71", "105_76", "105_2000", "105_67", "105_82", "105_103", "105_119", "105_10003", "105_10004", "105_10006", "105_128", "105_132", "105_10012", "105_10013", "105_10014", "105_137", "105_10007", "105_10009", 189, 58, 409, 234, 66, 560, "105_75", "105_2", "105_19", "105_30", "105_60", "105_63", "105_64", "105_66", "105_74", "105_80", "105_81", "105_84", "105_86", "105_85", "105_93", "105_95", "105_98", "105_101", "105_105", "105_102", "105_109", "105_112", "105_117", "105_116", "105_127", "105_126", "105_129", "105_133", "105_136", 523, "105_140", "105_143", "105_145", 394, 448, 456, 590, 609],
                "49": [160, 322, 334, 399, 489, 801, 60, 561, 562, 112, 116, 226, 350, 452, 583, 604, 605],
                "50": [161, 323, 335, 400, 503, 802, 113, 117, 351, 61],
                "84": [115, 140, 325, 381, 495, 552, 62, 68, 71, 132, 557, 599, 277, 269, 613, 111, 133, 878, 868, 500, 349, 396, 521, 635, 451, 459, 854],
                "2": [165, 198, 341, 63, 107, 390],
                "1": [164, 199, 340, 342, 493, 494, 428, 101, 122, 384],
                "89": [527, 529, 555, 572, 622, 69, 429],
                "82": [292, 326, 880, 885, "106_1", "106_5", "106_9", "106_11", "106_55", "106_27", "106_28", "106_29", "106_38", "106_39", "106_56", "106_71", "106_76", "106_2000", "106_67", "106_82", "106_103", "106_119", "106_10003", "106_10004", "106_10006", "106_128", "106_132", "106_10012", "106_10013", "106_10014", "106_137", "106_10007", "106_10009", 275, 70, 148, 73, 130, 127, 134, 138, 285, 220, 195, 227, 204, 431, 869, 283, 309, 313, 361, 364, 365, 639, 366, 445, 461, 432, 433, 519, 533, 499, 612, 648, 650, 877, "106_75", "106_2", "106_19", "106_30", "106_60", "106_63", "106_64", "106_66", "106_74", "106_80", 125, "106_81", "106_84", "106_86", "106_85", "106_93", "106_95", "106_98", "106_101", "106_105", "106_102", "106_109", "106_112", "106_117", "106_116", "106_127", "106_126", "106_129", "106_133", "106_136", 524, "106_140", "106_143", "106_145", 387, 449, 457, 579],
                "72": [526, 566, 268],
                "66": [295, 412, 462, 274, 142, 258, 272, 284, 286, 298, 573, 108, 454, 475],
                "51": [162, 166, 230, 297, 324, 336, 401, 504, 803, 146, 223, 262, 1501, 434, 615, 118, 352],
                "112": [331, 814, 143, 581],
                "54": [288, 339, 806, 422],
                "113": [332, 815, 149],
                "75": [471, 702, 867, 170],
                "114": [333, 816],
                "20": [415, 354, 476, 303],
                "55": [265, 289, 807, 423],
                "56": [266, 290, 808, 424],
                "78": [571, 267],
                "117": [404, 628],
                "76": [472],
                "187": [327, 582, 818],
                "79": [330, 570, 864],
                "85": [318, 565, 881, 382],
                "80": [362, 637, 643, 865, 852],
                "4": [435, 388, 870],
                "18": [391],
                "188": [410],
                "190": [405],
                "191": [406],
                "57": [425],
                "13": [593, 601, 592, 600],
                "186": [641],
                "222": [642],
                "189": [817],
                "73": [863],
                "48": [879],
                "(17, 49)": [25],
                "(17, 50)": [26],
                "(17, 51)": [27],
                "(17, 52)": [28],
                "(18, 49)": [141, 463, 704, 853, 29, 589],
                "(18, 88)": [72],
                "(18, 81)": [575, 380, 129, 587, 871],
                "(9, 48)": [171, 532, 531],
                "(9, 49)": [172, 436],
                "(9, 51)": [173, 559, 438],
                "(9, 50)": [174, 437],
                "(9, 52)": [175, 178, 439],
                "(9, 53)": [176, 179, 440],
                "(9, 54)": [180, 177, 441],
                "(9, 67)": [193, 640],
                "(18, 67)": [200, 594, 602],
                "(9, 55)": [206, 442],
                "(9, 56)": [207, 443],
                "(9, 57)": [208, 444],
                "(9, 81)": [256],
                "(18, 50)": [464, 705, 460],
                "(18, 86)": [307],
                "(9, 187)": [320],
                "(9, 189)": [321, 651],
                "(18, 52)": [466, 630],
                "(9, 1)": [367],
                "(9, 2)": [368],
                "(9, 4)": [369],
                "(9, 32)": [370],
                "(18, 69)": [574, 74, 254, 426, 447, 588, 872],
                "(18, 51)": [465, 706, 629],
                "(18, 53)": [467],
                "(18, 54)": [468],
                "(18, 55)": [481],
                "(18, 80)": [482],
                "(18, 66)": [556],
                "(18, 112)": [707],
                "(17, 67)": [887]
            }, "old_deleted_op2key": {
                "182": 69,
                "187": 88,
                "296": 81,
                "304": 115,
                "310": 76,
                "126": 66,
                "64": 1,
                "144": 54,
                "201": 114,
                "281": 77,
                "282": 78,
                "293": 117,
                "294": [18, 50],
                "363": [18, 52],
                "398": 84
            }, "op2key": {
                "0": 27,
                "347": 27,
                "596": 27,
                "809": 27,
                "151": 87,
                "228": 87,
                "485": 87,
                "861": 87,
                "152": 83,
                "486": 83,
                "483": 65,
                "517": 65,
                "632": 65,
                "812": 65,
                "181": 68,
                "484": 68,
                "518": 68,
                "633": 68,
                "813": 68,
                "312": 32,
                "469": 32,
                "474": 32,
                "491": 32,
                "511": 32,
                "513": 32,
                "514": 32,
                "530": 32,
                "554": 32,
                "619": 32,
                "631": 32,
                "638": 32,
                "811": 32,
                "859": 32,
                "883": 32,
                "158": 67,
                "319": 67,
                "157": 90,
                "856": 90,
                "155": 88,
                "329": 118,
                "328": 119,
                "414": 9,
                "473": 9,
                "700": 9,
                "567": 74,
                "701": 74,
                "163": 52,
                "167": 52,
                "231": 52,
                "337": 52,
                "470": 52,
                "804": 52,
                "168": 53,
                "287": 53,
                "338": 53,
                "805": 53,
                "346": 115,
                "402": 115,
                "413": 115,
                "703": 115,
                "348": 116,
                "141": [18, 49],
                "463": [18, 49],
                "704": [18, 49],
                "853": [18, 49],
                "411": 86,
                "866": 86,
                "882": 86,
                "886": 86,
                "636": 77,
                "305": 71,
                "416": 71,
                "576": 71,
                "577": 71,
                "621": 71,
                "153": 81,
                "154": 81,
                "278": 81,
                "279": 81,
                "299": 81,
                "487": 81,
                "510": 81,
                "528": 81,
                "550": 81,
                "551": 81,
                "553": 81,
                "563": 81,
                "624": 81,
                "820": 81,
                "850": 81,
                "857": 81,
                "860": 81,
                "150": 69,
                "403": 69,
                "488": 69,
                "525": 69,
                "564": 69,
                "569": 69,
                "611": 69,
                "625": 69,
                "819": 69,
                "851": 69,
                "858": 69,
                "862": 69,
                "343": 16,
                "626": 16,
                "344": 17,
                "623": 17,
                "105": {
                    "1": 70,
                    "2": 70,
                    "5": 70,
                    "9": 70,
                    "11": 70,
                    "55": 70,
                    "19": 70,
                    "27": 70,
                    "28": 70,
                    "29": 70,
                    "38": 70,
                    "39": 70,
                    "56": 70,
                    "71": 70,
                    "75": 70,
                    "76": 70,
                    "2000": 70,
                    "30": 70,
                    "60": 70,
                    "63": 70,
                    "64": 70,
                    "66": 70,
                    "67": 70,
                    "74": 70,
                    "80": 70,
                    "81": 70,
                    "82": 70,
                    "84": 70,
                    "85": 70,
                    "86": 70,
                    "93": 70,
                    "95": 70,
                    "98": 70,
                    "101": 70,
                    "105": 70,
                    "102": 70,
                    "103": 70,
                    "109": 70,
                    "112": 70,
                    "117": 70,
                    "119": 70,
                    "10003": 70,
                    "10004": 70,
                    "10006": 70,
                    "116": 70,
                    "127": 70,
                    "126": 70,
                    "129": 70,
                    "128": 70,
                    "132": 70,
                    "10012": 70,
                    "10013": 70,
                    "10014": 70,
                    "133": 70,
                    "136": 70,
                    "137": 70,
                    "140": 70,
                    "143": 70,
                    "145": 70,
                    "10007": 70,
                    "10009": 70
                },
                "490": 70,
                "492": 70,
                "568": 70,
                "620": 70,
                "810": 70,
                "855": 70,
                "884": 70,
                "160": 49,
                "322": 49,
                "334": 49,
                "399": 49,
                "489": 49,
                "801": 49,
                "161": 50,
                "323": 50,
                "335": 50,
                "400": 50,
                "503": 50,
                "802": 50,
                "115": 84,
                "140": 84,
                "325": 84,
                "381": 84,
                "495": 84,
                "552": 84,
                "165": 2,
                "198": 2,
                "341": 2,
                "164": 1,
                "199": 1,
                "340": 1,
                "342": 1,
                "493": 1,
                "494": 1,
                "527": 89,
                "529": 89,
                "555": 89,
                "572": 89,
                "622": 89,
                "106": {
                    "1": 82,
                    "2": 82,
                    "5": 82,
                    "9": 82,
                    "11": 82,
                    "55": 82,
                    "19": 82,
                    "27": 82,
                    "28": 82,
                    "29": 82,
                    "38": 82,
                    "39": 82,
                    "56": 82,
                    "71": 82,
                    "75": 82,
                    "76": 82,
                    "2000": 82,
                    "30": 82,
                    "60": 82,
                    "63": 82,
                    "64": 82,
                    "66": 82,
                    "67": 82,
                    "74": 82,
                    "80": 82,
                    "81": 82,
                    "82": 82,
                    "84": 82,
                    "85": 82,
                    "86": 82,
                    "93": 82,
                    "95": 82,
                    "98": 82,
                    "101": 82,
                    "105": 82,
                    "102": 82,
                    "103": 82,
                    "109": 82,
                    "112": 82,
                    "117": 82,
                    "119": 82,
                    "10003": 82,
                    "10004": 82,
                    "10006": 82,
                    "116": 82,
                    "127": 82,
                    "126": 82,
                    "129": 82,
                    "128": 82,
                    "132": 82,
                    "10012": 82,
                    "10013": 82,
                    "10014": 82,
                    "133": 82,
                    "136": 82,
                    "137": 82,
                    "140": 82,
                    "143": 82,
                    "145": 82,
                    "10007": 82,
                    "10009": 82
                },
                "292": 82,
                "326": 82,
                "880": 82,
                "885": 82,
                "526": 72,
                "566": 72,
                "295": 66,
                "412": 66,
                "462": 66,
                "162": 51,
                "166": 51,
                "230": 51,
                "297": 51,
                "324": 51,
                "336": 51,
                "401": 51,
                "504": 51,
                "803": 51,
                "575": [18, 81],
                "331": 112,
                "814": 112,
                "288": 54,
                "339": 54,
                "806": 54,
                "332": 113,
                "815": 113,
                "471": 75,
                "702": 75,
                "867": 75,
                "171": [9, 48],
                "173": [9, 51],
                "175": [9, 52],
                "176": [9, 53],
                "180": [9, 54],
                "193": [9, 67],
                "333": 114,
                "816": 114,
                "207": [9, 56],
                "415": 20,
                "265": 55,
                "289": 55,
                "807": 55,
                "266": 56,
                "290": 56,
                "808": 56,
                "571": 78,
                "404": 117,
                "464": [18, 50],
                "705": [18, 50],
                "472": 76,
                "327": 187,
                "582": 187,
                "818": 187,
                "330": 79,
                "570": 79,
                "864": 79,
                "318": 85,
                "565": 85,
                "881": 85,
                "362": 80,
                "637": 80,
                "643": 80,
                "865": 80,
                "466": [18, 52],
                "574": [18, 69],
                "465": [18, 51],
                "706": [18, 51],
                "467": [18, 53],
                "468": [18, 54],
                "481": [18, 55],
                "482": [18, 80],
                "556": [18, 66],
                "593": 13,
                "601": 13,
                "707": [18, 112],
                "817": 189,
                "863": 73,
                "879": 48,
                "887": [17, 67],
                "1": 87,
                "183": 87,
                "2": 83,
                "184": 83,
                "3": 65,
                "54": 65,
                "120": 65,
                "156": 65,
                "188": 65,
                "252": 65,
                "314": 65,
                "654": 65,
                "4": 68,
                "65": 68,
                "121": 68,
                "191": 68,
                "253": 68,
                "315": 68,
                "655": 68,
                "5": 32,
                "6": 192,
                "7": 27,
                "15": 90,
                "257": 67,
                "16": 88,
                "17": 118,
                "18": 119,
                "33": 77,
                "380": [18, 81],
                "143": 112,
                "581": 112,
                "382": 85,
                "273": 74,
                "427": 74,
                "189": 70,
                "190": 71,
                "478": 69,
                "51": 81,
                "67": 81,
                "119": 81,
                "185": 81,
                "229": 81,
                "300": 81,
                "301": 81,
                "345": 81,
                "52": 69,
                "53": 32,
                "55": 32,
                "56": 16,
                "57": 17,
                "58": 70,
                "409": 70,
                "60": 49,
                "62": 84,
                "68": 84,
                "71": 84,
                "132": 84,
                "354": 20,
                "477": 81,
                "557": 84,
                "599": 84,
                "428": 1,
                "435": 4,
                "422": 54,
                "423": 55,
                "424": 56,
                "425": 57,
                "8": 67,
                "32": 86,
                "200": [18, 67],
                "640": [9, 67],
                "641": 186,
                "642": 222,
                "644": 97,
                "645": 98,
                "646": 99,
                "647": 100,
                "74": [18, 69],
                "254": [18, 69],
                "426": [18, 69],
                "129": [18, 81],
                "307": [18, 86],
                "63": 2,
                "69": 89,
                "72": [18, 88],
                "194": 81,
                "268": 72,
                "149": 113,
                "233": 27,
                "234": 70,
                "306": 87,
                "447": [18, 69],
                "629": [18, 51],
                "275": 82,
                "128": 32,
                "446": 32,
                "70": 82,
                "277": 84,
                "274": 66,
                "148": 82,
                "66": 70,
                "73": 82,
                "146": 51,
                "147": 52,
                "130": 82,
                "127": 82,
                "134": 82,
                "138": 82,
                "285": 82,
                "142": 66,
                "220": 82,
                "159": 9,
                "223": 51,
                "224": 52,
                "225": 53,
                "561": 49,
                "195": 82,
                "197": 27,
                "227": 82,
                "258": 66,
                "204": 82,
                "431": 82,
                "272": 66,
                "271": 32,
                "262": 51,
                "263": 52,
                "264": 53,
                "269": 84,
                "267": 78,
                "284": 66,
                "869": 82,
                "283": 82,
                "286": 66,
                "309": 82,
                "298": 66,
                "313": 82,
                "311": 32,
                "361": 82,
                "364": 82,
                "365": 82,
                "639": 82,
                "366": 82,
                "367": [9, 1],
                "368": [9, 2],
                "369": [9, 4],
                "370": [9, 32],
                "407": 65,
                "408": 68,
                "410": 188,
                "405": 190,
                "406": 191,
                "573": 66,
                "445": 82,
                "1501": 51,
                "1502": 52,
                "1503": 53,
                "461": 82,
                "432": 82,
                "433": 82,
                "562": 49,
                "434": 51,
                "476": 20,
                "519": 82,
                "533": 82,
                "499": 82,
                "560": 70,
                "615": 51,
                "616": 52,
                "617": 53,
                "612": 82,
                "613": 84,
                "648": 82,
                "649": 32,
                "650": 82,
                "877": 82,
                "101": 1,
                "122": 1,
                "102": 81,
                "124": 81,
                "186": 81,
                "512": 81,
                "103": 69,
                "104": 69,
                "107": 2,
                "48": 71,
                "123": 71,
                "196": 71,
                "203": 71,
                "270": 71,
                "276": 71,
                "558": 71,
                "137": 67,
                "479": 81,
                "480": 32,
                "585": 71,
                "110": 86,
                "111": 84,
                "112": 49,
                "113": 50,
                "116": 49,
                "117": 50,
                "118": 51,
                "114": 86,
                "255": 86,
                "139": 86,
                "192": 86,
                "125": 82,
                "430": 86,
                "131": 86,
                "133": 84,
                "226": 49,
                "136": 32,
                "878": 84,
                "145": 86,
                "868": 84,
                "169": 86,
                "202": 86,
                "500": 84,
                "250": 86,
                "232": 86,
                "251": 86,
                "291": 86,
                "308": 86,
                "353": 86,
                "349": 84,
                "350": 49,
                "351": 50,
                "352": 51,
                "397": 86,
                "396": 84,
                "420": 86,
                "421": 86,
                "502": 86,
                "520": 86,
                "522": 86,
                "521": 84,
                "523": 70,
                "524": 82,
                "584": 86,
                "634": 86,
                "635": 84,
                "652": 86,
                "19": 9,
                "29": [18, 49],
                "59": 71,
                "61": 50,
                "108": 66,
                "109": 52,
                "630": [18, 52],
                "429": 89,
                "9": 97,
                "10": 98,
                "11": 99,
                "12": 100,
                "13": 101,
                "14": 102,
                "30": 103,
                "31": 104,
                "20": 74,
                "21": 52,
                "22": 53,
                "23": 115,
                "24": 116,
                "25": [17, 49],
                "26": [17, 50],
                "27": [17, 51],
                "28": [17, 52],
                "302": 69,
                "303": 20,
                "280": 81,
                "460": [18, 50],
                "384": 1,
                "385": 81,
                "386": 69,
                "387": 82,
                "388": 4,
                "389": 32,
                "390": 2,
                "391": 18,
                "392": 16,
                "393": 17,
                "394": 70,
                "395": 86,
                "448": 70,
                "449": 82,
                "450": 71,
                "451": 84,
                "452": 49,
                "453": 86,
                "454": 66,
                "534": 88,
                "475": 66,
                "455": 32,
                "456": 70,
                "457": 82,
                "458": 86,
                "459": 84,
                "608": 69,
                "590": 70,
                "609": 70,
                "610": 86,
                "578": 81,
                "586": 81,
                "597": 81,
                "598": 81,
                "873": 81,
                "874": 81,
                "875": 81,
                "876": 81,
                "607": 88,
                "580": 77,
                "606": 77,
                "579": 82,
                "587": [18, 81],
                "588": [18, 69],
                "583": 49,
                "589": [18, 49],
                "604": 49,
                "605": 49,
                "591": 81,
                "595": 67,
                "603": 67,
                "592": 13,
                "600": 13,
                "594": [18, 67],
                "602": [18, 67],
                "628": 117,
                "871": [18, 81],
                "872": [18, 69],
                "852": 80,
                "854": 84,
                "870": 4,
                "172": [9, 49],
                "174": [9, 50],
                "559": [9, 51],
                "532": [9, 48],
                "177": [9, 54],
                "178": [9, 52],
                "179": [9, 53],
                "206": [9, 55],
                "208": [9, 57],
                "256": [9, 81],
                "321": [9, 189],
                "320": [9, 187],
                "170": 75,
                "436": [9, 49],
                "437": [9, 50],
                "438": [9, 51],
                "439": [9, 52],
                "440": [9, 53],
                "441": [9, 54],
                "442": [9, 55],
                "443": [9, 56],
                "444": [9, 57],
                "531": [9, 48],
                "651": [9, 189]
            }
        },
        "game": {
            "sensitivity_s": 50, "sensitivity_h": {
                "1": 50,
                "10003": 50,
                "10004": 50,
                "101": 50,
                "102": 50,
                "103": 50,
                "105": 50,
                "109": 50,
                "11": 50,
                "112": 50,
                "116": 50,
                "117": 50,
                "119": 50,
                "126": 50,
                "127": 50,
                "128": 50,
                "129": 50,
                "19": 50,
                "2": 50,
                "2000": 50,
                "27": 50,
                "28": 50,
                "29": 50,
                "30": 50,
                "38": 50,
                "39": 50,
                "5": 50,
                "55": 50,
                "56": 50,
                "60": 50,
                "63": 50,
                "64": 50,
                "66": 50,
                "67": 50,
                "71": 50,
                "74": 50,
                "75": 50,
                "76": 50,
                "80": 50,
                "81": 50,
                "82": 50,
                "84": 50,
                "85": 50,
                "86": 50,
                "9": 50,
                "93": 50,
                "95": 50,
                "98": 50,
                "133": 50,
                "136": 50,
                "140": 50,
                "143": 50,
                "145": 50
            }
        }
    })

    const getKey2op = computed(() => {
        return pckey.value.control.key2op_lst
    })

    const getOp2key = computed(() => {
        return pckey.value.control.op2key
    })

    const getGame = computed(() => {
        return pckey.value.game
    })

    return {pckey, getKey2op, getOp2key, getGame}
}, {persist: true})
